Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RATIS-2159. TestRaftWithSimulatedRpc could "fail to retain". #1153

Closed
wants to merge 2 commits into from

Conversation

szetszwo
Copy link
Contributor

RATIS-2159

In SegmentedRaftLog.retainLog(..),

  1. it gets an entry from the cache, and then
  2. calls retain().

The entry could be removed and released in between (1) and (2). It leads to the "fail to retain" failure.

return entry;
} catch (IllegalStateException ignore) {
// the entry could be removed from the cache and released.
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ignore this exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the entry is already released, it is the same as a cache miss.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have updated the comment for clarifying it.

@szetszwo
Copy link
Contributor Author

This was fixed as a part of RATIS-2151.

@szetszwo szetszwo closed this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants